﻿  
@model HomeCareLibrary.Models.LoginPasswordModel
<div class="col-lg-9 col-sm-9 right_part">
            <div class="Changelogin-page">
              <div class="main-content">
                <div class="personalization-content no-padding">
                  <div class="personalization-bg">
                    <div class="personalization-inn">
                      <div class="personalization-data ChangeL-per-data" > <br />
                        <h3 class="personalization-heading">Change Login</h3>
                       
                           @if (Session[HomeCareLibrary.Constants.SessionConstants.MODE] == null)
                                                    {
                                     
                                     }
                           else if (Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == "iphoneApp" || Session[HomeCareLibrary.Constants.SessionConstants.MODE].ToString() == "androidApp")
                                                   
                                     {


                                         using (Ajax.BeginForm("UpdateUserNamePassword", "Personalization", new AjaxOptions
                                        {
                                            HttpMethod = "POST",
                                            LoadingElementId = "wait",
                                            OnSuccess = "success",



                                        }, new { id = "FormWebView" }))
                                       {
                                                               @Html.HiddenFor(m => m.user_id)
                              
                                                   <p class="top-data">To change your login information, enter<br>
                                                  your new info and then click the <br>
                                                  'Submit" button.</p>
                        
                                                <div class="Dwelling-part login-form">
                                                  <div class="form-per">
                                                    <form role="form">
                                                    <div class="update text-center" id="updateusername" style="display:none;">
                                                                    <label class="red">
                                                                       updated. </label>
                                                                  </div>

                                                        
                                                      <div class="form-group">
                                                        <label for="emailaddress">Username or email address</label>
                               

                                                            @Html.TextBoxFor(m => m.user_name, new {@class = "input-box form-control"})

                                                      </div>
                                                      <div class="form-group">
                                                        <label for="password">Password</label>
                              
                                                          @Html.TextBoxFor(m => m.password, new {@class = "input-box form-control",@type="password"})
                                                           @Html.Hidden("hdnUserID", @Model.user_id)
                                                      </div>
                                                      <br />
                                                      <div class="button">
                                                         <a  id="btnLogin"  style="cursor:pointer;" class="btn-per">Submit</a>
                                                      </div>
                                                    </form>
                                                  </div>
                                                </div>

                                                   }
                           }
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>

      <div id="wait" style="display:none;width:100%;z-index: 999;height:100%;position:absolute;top:0; bottom:0;left:0; right:0;padding:2px;background-color: rgba(0, 0, 0, 0.4);">
                    <div style="width: 86px; margin: 27% auto 0px;"><img style="" src='@Url.Content("~/images/demo_wait.gif")'  /><br>Loading..</div></div>

          </div>
@section script {
@*<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
     <script src="@Url.Content("~/js/webview/adminchangelogin.js")" type="text/javascript"></script>*@

     @Scripts.Render("~/Scripts/BundledScriptsAdminChangeLogin")

    <script type="text/javascript">
        function isValidEmailAddress(emailAddress) {
            var pattern = new RegExp(/^(("[\w-\s]+")|([\w-]+(?:\.[\w-]+)*)|("[\w-\s]+")([\w-]+(?:\.[\w-]+)*))(@@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$)|(@@\[?((25[0-5]\.|2[0-4][0-9]\.|1[0-9]{2}\.|[0-9]{1,2}\.))((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\.){2}(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[0-9]{1,2})\]?$)/i);
            return pattern.test(emailAddress);
        }
      </script>

    }
